package com.sudo.boot.mapper.sys.model.bo;

import com.sudo.boot.base.constant.enums.EnumStatus;
import com.sudo.boot.base.util.PatternUtil;
import com.sudo.boot.common.constant.enums.ExceptionLimit;
import com.sudo.boot.common.constant.enums.RunModeType;
import com.sudo.boot.core.validenum.EnumValues;
import com.sudo.boot.core.validenum.NotBlankThenPattern;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;

@Data
public class SysLocalJobBoSave {
    @NotBlank(message = "任务标题不能为空")
    private String jobTitle;

    @NotBlank(message = "模块名不能为空")
    private String beanName;

    @NotBlank(message = "方法名不能为空")
    private String methodName;

    private String methodParams;
    // Cron表达式
    @NotBlank(message = "cron表达式不能为空")
    private String cronExpression;

    @NotBlank(message = "日志状态不能为空")
    @EnumValues(EnumStatus.class)
    private String logStatus;

    @NotBlank(message = "邮件状态不能为空")
    @EnumValues(EnumStatus.class)
    private String mailStatus;

    private String mailAddress;

    private String note;

    @NotBlankThenPattern(regexp = PatternUtil.commaSplitNumber,message = "子任务ID格式不正确")
    private String nextJobIds;

    @NotBlank(message = "子任务运行模式不能为空")
    @EnumValues(RunModeType.class)
    private String nextJobMode;

    @NotBlank(message = "子任务限制不能为空")
    @EnumValues(ExceptionLimit.class)
    private String nextJobLimit;

}
